import request from '@/utils/request'

// 查询物资列表
export function listElecMaterial(query) {
  return request({
    url: '/elec/elecMaterial/list',
    method: 'get',
    params: query
  })
}

// 查询物资列表
export function selectElecMaterialWarehouseList(query) {
  return request({
    url: '/elec/elecMaterial/selectElecMaterialWarehouseList',
    method: 'get',
    params: query
  })
}

// 查询仓库下拉框
export function listWarehouseOptions(query) {
  return request({
    url: '/bas/basWarehouse/warehouseOptions',
    method: 'get',
    params: query
  })
}

// 查询资产分类列表
export function listSortOptions(query) {
  return request({
    url: '/bas/basSort/list',
    method: 'get',
    params: query
  })
}

// 查询密品柜子列表
export function listCabinetOptions(query) {
  return request({
    url: '/bas/basCabinet/cabinetOptions',
    method: 'get',
    params: query
  })
}

// 查询层格列表
export function listBasGridOptions(query) {
  return request({
    url: '/bas/basGrid/list',
    method: 'get',
    params: query
  })
}

// 查询供应商下拉框
export function listProviderOptions(query) {
  return request({
    url: '/bas/basProvider/providerOptions',
    method: 'get',
    params: query
  })
}

// 查询计量单位下拉框
export function listUnitOptions(query) {
  return request({
    url: '/bas/basUnit/unitOptions',
    method: 'get',
    params: query
  })
}

// 查询物资详细
export function getElecMaterial(materialId) {
  return request({
    url: '/elec/elecMaterial/' + materialId,
    method: 'get'
  })
}

// 新增物资
export function addElecMaterial(data) {
  return request({
    url: '/elec/elecMaterial',
    method: 'post',
    data: data
  })
}

// 修改物资
export function updateElecMaterial(data) {
  return request({
    url: '/elec/elecMaterial',
    method: 'put',
    data: data
  })
}

// 删除物资
export function delElecMaterial(materialId) {
  return request({
    url: '/elec/elecMaterial/' + materialId,
    method: 'delete'
  })
}



// 查询需要维修物资列表
export function listElecMaterialRepair(query) {
  return request({
    url: '/elec/elecMaterial/listRepair',
    method: 'get',
    params: query
  })
}

// 检修物资
export function repairMaterial(materialId) {
  return request({
    url: '/elec/elecMaterial/repairMaterial/' + materialId,
    method: 'post'
  })
}
